<template>
	<div class="item_show_container" @click="gotoItem(item.id)">
		<div class="image_container">
			<my-image type="items" :icon="item.iconUrl" :size="41"></my-image>
			<p class="number">{{ item.amount }}</p>
		</div>
		<div>{{ item.name }}</div>
	</div>
</template>

<script>
	import MyImage from "@/components/Image.vue";
	export default {
		name: "SimpleItemShow",
		props: ["item"],
		components:{
			MyImage
		},
		methods: {
			gotoItem(id) {
				this.$router.push({
					path:"/item/info",
					query:{
						id
					}
				})
			},
		},
	};
</script>

<style scoped>
	.item_show_container {
		background-color: rgba(0, 0, 0, 0.6);
		border: 1px solid black;
		border-radius: 4px;
		padding: 4px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 5px;
		min-width: 100px;
		float: left;
		color: rgb(255, 255, 255);
	}

	.image_container {
		position: relative;
		width: 40px;
		margin-bottom: -16px;
	}

	.number {
		position: relative;
		float: right;
		height: 16px;
		line-height: 16px;
		margin: 0;
		z-index: 10;
		top: -16px;
	}

	.image {
		position: relative;
		border-radius: 2px;
		float: left;
		width: 40px;
		height: 40px;
	}
</style>